package hospital;

import java.io.Serializable;
import java.util.Objects;

public class Member implements Serializable {
    //1:实现之前的超市(名称属性)会员积分系统,有如下的基本功能(实现开卡和查询即可)，会员有卡号和积分两个属性：
    //查询剩余积分
    //开卡
    //采用序列化的方式,每次启动如果没有超市对象,则创建新对象;否则从序列化的文件中读取,退出时保存所有数据。后续处理方式相同.
    private String no;
    private int socre;

    @Override
    public String toString() {
        return "Member{" +
                "no='" + no + '\'' +
                ", socre=" + socre +
                '}';
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public int getSocre() {
        return socre;
    }

    public void setSocre(int socre) {
        this.socre = socre;
    }

    public Member(String no, int socre) {
        this.no = no;
        this.socre = socre;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Member member = (Member) o;
        return Objects.equals(no, member.no);
    }

    @Override
    public int hashCode() {
        return Objects.hash(no);
    }
}
